<!DOCTYPE html>
<html lang="en">
<#assign security=JspTaglibs["http://www.springframework.org/security/tags"] />
<head>
    <meta charset="UTF-8">
    <title>关于我们</title>
    <link rel="stylesheet" href="css/layui.css" media="all">
    <link rel="stylesheet" href="css/doc.css" media="all">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
    <script src="https://www.layuicdn.com/layui/layui.js"></script>
</head>

<body>
<div class="kit-doc">
    <blockquote class="layui-elem-quote">关于我们</blockquote>
    <table class="layui-table">
        <colgroup>
            <col width="5">
            <col width="70">
            <col width="170">
            <col width="70">
            <col width="50">
            <col width="100">
            <col width="100">
            <col width="100">
            <col width="50">
        </colgroup>
        <thead>
        <tr>
            <th>id</th>
            <th>公司名称</th>
            <th>公司logo</th>
            <th>公司地址</th>
            <th>地址经度</th>
            <th>地址纬度</th>
            <th>公司电话</th>
            <th>营业时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <#list cors as c>
            <tr>
                <td>${c.id}</td>
                <td>${c.corporateName}</td>
                <td>${c.corporateLogo}</td>
                <td>${c.corporateLocation}</td>
                <td>${c.corporateLongitude}</td>
                <td>${c.corporateLatitude}</td>
                <td>${c.corporatePhone}</td>
                <td>${c.corporateHours}</td>
                <td>
                    <@security.authorize access="hasRole('ADMIN')">
                        <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#update" onclick="update(${c.id})">修改</button></td>
                    </@security.authorize>
            </tr>
        </#list>
        </tbody>
    </table>
</div>
<!-- 修改  -->
<div class="modal fade" id="update" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form method="post" action="/updateCorporateInfo">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                                aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="exampleModalLabel">修改</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">id:</label>
                        <input type="text" name="id" id="id" class="form-control"  required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">公司名称:</label>
                        <input type="text" name="corporateName" id="corporateName" class="form-control"  required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">公司logo:</label>
                        <input type="text" name="corporateLogo" id="corporateLogo" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">公司地址:</label>
                        <input type="text" name="corporateLocation" id="corporateLocation" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">地址经度:</label>
                        <input type="text" name="corporateLongitude" id="corporateLongitude" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">地址纬度:</label>
                        <input type="text" name="corporateLatitude" id="corporateLatitude" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">公司电话:</label>
                        <input type="text" name="corporatePhone" id="corporatePhone" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">营业时间:</label>
                        <input type="text" name="corporateHours" id="corporateHours" class="form-control" required>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <input type="submit" class="btn btn-primary" value="修改"/>
                </div>
        </div>
    </div>
    </form>
</div>
<div class="layui-bg-gray" style="padding: 50px;">
    <div class="layui-row layui-col-space16">
        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header"><p style="font-size:17px;"><strong>公司简介</strong></p></div>
                <div class="layui-card-body">
                  <p style="font-size:16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;致一科技技术有限公司（简称“致一科技”）成立于2021年4月1日，
                    位于湖南省湘潭市。是一家从事软件开发的公司。主要产品有：微信小程序
                    后台管理系统。公司目前旗下有6人。竭诚与国内外商家双赢合作，共同发展，共创辉煌！</p>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header"><p style="font-size:17px;"><strong>公司成员</strong></p></div>
                <div class="layui-card-body">
                    <p style="font-size:16px;">熊小龙&nbsp;&nbsp;宁文华 &nbsp;杨深俊&nbsp;安锐&nbsp;唐珠海&nbsp;刘健</p>
                </div>
            </div>
        </div>
        <img src="image/ZY.png" style="position: absolute;top:220px; width: 330px;height: 430px;">
    </div>

</div>

<div id="demo" style="margin-left: 470px;"></div>
<script src="js/jquery-3.5.1.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/layui.all.js"></script>
<script>
    //获取项目路径
    function URL() {
        return window.location.protocol + "//" + window.location.host + "/";
    }
    /**
    * @Author: 杨深俊
    * @Date: 2021/4/9
    * @Time: 9:09
     * id 公司id
     * corporateName 公司名字
     * corporateLogo 公司logo
     * corporateLocation  公司地址
     * corporateLongitude 地址经度
     * corporateLatitude 地址纬度
     * corporatePhone 公司电话
     * corporateHours 公司营业时间
    */
    function update(e) {
        $.get(
            "getCorporateInfo?id=" + e,
            function (data) {
                data = JSON.parse(data);
                $("#id").val(data.corporateInfo.id);
                $("#corporateName").val(data.corporateInfo.corporateName);
                $("#corporateLogo").val(data.corporateInfo.corporateLogo);
                $("#corporateLocation").val(data.corporateInfo.corporateLocation);
                $("#corporateLongitude").val(data.corporateInfo.corporateLongitude);
                $("#corporateLatitude").val(data.corporateInfo.corporateLatitude);
                $("#corporatePhone").val(data.corporateInfo.corporatePhone);
                $("#corporateHours").val(data.corporateInfo.corporateHours);
            }
        )
    }
</script>
</body>
</html>